package dev.bong.mapper;

import dev.bong.annotation.AutoFill;
import dev.bong.enumeration.OperationType;
import dev.bong.pojo.entity.LabRepair;
import dev.bong.pojo.entity.LabRegister;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface LabRepairMapper {

    List<LabRepair> selectAll();

    List<LabRepair> selectByLabIds(List<Integer> ids);

    @AutoFill(value = OperationType.INSERT)
    void addRepair(LabRepair labRepair);

    @Update("update lab_repair set repair_status = #{status}, update_by = #{userId},update_time=#{now} " +
            "where id = #{repairId}")
    void updateRepairStatus(Integer repairId, Integer status, Integer userId, LocalDateTime now);


    void updateRepairSituation(Integer repairId, String situation,Integer userId, LocalDateTime now);

    List<LabRepair> selectByTeacherId(Integer teacherId);
}
